package com.dfbz.bigdata.domain;


import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName tb_common_safe
 */
@TableName(value ="tb_common_safe")
@Data
public class CommonSafe implements Serializable {
    /**
     * 保险表
     */
    @TableId
    private Long safeId;

    /**
     * 投保人
     */
    private Long policyId;

    /**
     * 受保人
     */
    private Long insurantId;

    /**
     * 保障信息
     */
    private String safeText;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 保障时间
     */
    private Integer safeTime;

    /**
     * 保障价值
     */
    private Double safeValue;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 创建人
     */
    private Long createUser;

    /**
     * 修改人
     */
    private Long updateUser;

    /**
     * 是否删除
     */
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CommonSafe other = (CommonSafe) that;
        return (this.getSafeId() == null ? other.getSafeId() == null : this.getSafeId().equals(other.getSafeId()))
            && (this.getPolicyId() == null ? other.getPolicyId() == null : this.getPolicyId().equals(other.getPolicyId()))
            && (this.getInsurantId() == null ? other.getInsurantId() == null : this.getInsurantId().equals(other.getInsurantId()))
            && (this.getSafeText() == null ? other.getSafeText() == null : this.getSafeText().equals(other.getSafeText()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getSafeTime() == null ? other.getSafeTime() == null : this.getSafeTime().equals(other.getSafeTime()))
            && (this.getSafeValue() == null ? other.getSafeValue() == null : this.getSafeValue().equals(other.getSafeValue()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSafeId() == null) ? 0 : getSafeId().hashCode());
        result = prime * result + ((getPolicyId() == null) ? 0 : getPolicyId().hashCode());
        result = prime * result + ((getInsurantId() == null) ? 0 : getInsurantId().hashCode());
        result = prime * result + ((getSafeText() == null) ? 0 : getSafeText().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getSafeTime() == null) ? 0 : getSafeTime().hashCode());
        result = prime * result + ((getSafeValue() == null) ? 0 : getSafeValue().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", safeId=").append(safeId);
        sb.append(", policyId=").append(policyId);
        sb.append(", insurantId=").append(insurantId);
        sb.append(", safeText=").append(safeText);
        sb.append(", startTime=").append(startTime);
        sb.append(", safeTime=").append(safeTime);
        sb.append(", safeValue=").append(safeValue);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}